package com.prathiba.jumbledword;

public class Guess {
	private String guessedWord;
	private boolean valid;

	public Guess(String guessedWord, boolean valid) {
		this.guessedWord = guessedWord;
		this.valid = valid;
	}

	public String getGuessedWord() {
		return guessedWord;
	}

	public boolean getValid() {
		return valid;
	}

	@Override
	public String toString() {
		return "Guess [guessedWord=" + guessedWord + ", valid=" + valid + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((guessedWord == null) ? 0 : guessedWord.hashCode());
		result = prime * result + (valid ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Guess other = (Guess) obj;
		if (guessedWord == null) {
			if (other.guessedWord != null)
				return false;
		} else if (!guessedWord.equals(other.guessedWord))
			return false;
		if (valid != other.valid)
			return false;
		return true;
	}

}
